IF EXISTS ( SELECT 'X' FROM sys.views WHERE name = 'vMastersysdtslog90' AND schema_id = 1 )
BEGIN
     DROP VIEW dbo.vMastersysdtslog90
END
GO

CREATE VIEW dbo.vMastersysdtslog90
AS
/*
 *
 * vMastersysdtslog90
 *
 * Purpose:      
 *
 * Inputs:       
 *
 * Assumes:      
 *
 * Effects:      
 *
 * Returns:      
 *
 * Calling
 * Application:  
 *
 * Note(s):      
 *
 * Author(s):    NOVA Concepts Ltd.
 *
 * Change Log:   Initial Release, 12/05/2011, 1.00.0000
 *
 */
SELECT i.SrvrInstncFullName,
       i.SrvrInstncId, 
       SrvrDatabaseName = d.DatabaseName,
       [id]             = EventLogId,
       [event]          = MiscVC1,
       [computer]       = MiscVC2,
       [operator]       = MiscVC3,
       [source]         = CONVERT( varchar(1024), TraceText ),
       [sourceid]       = MiscGUID1,
       [executionid]    = MiscGUID4,
       [starttime]      = MiscDt1,
       [endtime]        = MiscDt2,
       [datacode]       = MiscInt1,
       [databytes]      = TraceImage,
       [message]        = CONVERT( varchar(2048), LogText )
FROM   dbo.MasterEventLog l INNER JOIN dbo.SrvrInstncDatabase d
          ON l.SrvrInstncDatabaseId = d.SrvrInstncDatabaseId
       INNER JOIN dbo.SrvrInstnc i
          ON d.SrvrInstncId = i.SrvrInstncId 
WHERE  l.LogByApp          = 'Integration Services'
AND    l.LogByAppSubSystem = 'sp_dts_addlogentry'
GO
